% Ashish Newale, Purdue University
% 4-5-2013
% purdue_flames.m

close all
clear all

disp('purdue_flames ...')

expdir = '../../../exp/Purdue_Flames/';
outdir = '../../../out/Purdue_Flames/';
pltdir = '../../Manuals/FDS_Validation_Guide/SCRIPT_FIGURES/Purdue_Flames/';

M = importdata([outdir,'7p1_cm_methane_4mm_line.csv']);

exp_stride=1;

% Vertical Velocity

%Z/D = .85
col1 = find(strcmp(M.colheaders,'W_mean-x'));
col2 = find(strcmp(M.colheaders,'W_mean'));
radial_profile([pltdir,'7p1_cm_CH4_w_zd_p85'],'line',[col1,col2],0,'relative',10, ...
               'Radial Position (m)','Vertical Velocity (m/s)','{\itz/D} = 0.85','','Northeast', ...
               -.05,.05,.02,-.05,.05,.02,0,3,.5,[outdir,'7p1_cm_methane_4mm_git.txt'], ...
               [expdir,'7p1_cm_CH4_w_zd_p85.csv'],'bo','Exp',exp_stride, ...
               [outdir,'7p1_cm_methane_4mm_line.csv'],'b--','FDS {\it\deltax} = 4 mm 1 mesh', ...
               [outdir,'7p1_cm_methane_4mm_16mesh_line.csv'],'b:','FDS {\it\deltax} = 4 mm 16 mesh', ...
               [outdir,'7p1_cm_methane_2mm_16mesh_line.csv'],'b-','FDS {\it\deltax} = 2 mm 16 mesh')

%Z/D = .70
col1 = find(strcmp(M.colheaders,'1W_mean-x'));
col2 = find(strcmp(M.colheaders,'1W_mean'));
radial_profile([pltdir,'7p1_cm_CH4_w_zd_p70'],'line',[col1,col2],0,'relative',10, ...
               'Radial Position (m)','Vertical Velocity (m/s)','{\itz/D} = 0.70','','Northeast', ...
               -.05,.05,.02,-.05,.05,.02,0,3,.5,[outdir,'7p1_cm_methane_4mm_git.txt'], ...
               [expdir,'7p1_cm_CH4_w_zd_p70.csv'],'bo','Exp',exp_stride, ...
               [outdir,'7p1_cm_methane_4mm_line.csv'],'b--','FDS {\it\deltax} = 4 mm 1 mesh', ...
               [outdir,'7p1_cm_methane_4mm_16mesh_line.csv'],'b:','FDS {\it\deltax} = 4 mm 16 mesh', ...
               [outdir,'7p1_cm_methane_2mm_16mesh_line.csv'],'b-','FDS {\it\deltax} = 2 mm 16 mesh')

%Z/D = .56
col1 = find(strcmp(M.colheaders,'2W_mean-x'));
col2 = find(strcmp(M.colheaders,'2W_mean'));
radial_profile([pltdir,'7p1_cm_CH4_w_zd_p56'],'line',[col1,col2],0,'relative',10, ...
               'Radial Position (m)','Vertical Velocity (m/s)','{\itz/D} = 0.56','','Northeast', ...
               -.05,.05,.02,-.05,.05,.02,0,3,.5,[outdir,'7p1_cm_methane_4mm_git.txt'], ...
               [expdir,'7p1_cm_CH4_w_zd_p56.csv'],'bo','Exp',exp_stride, ...
               [outdir,'7p1_cm_methane_4mm_line.csv'],'b--','FDS {\it\deltax} = 4 mm 1 mesh', ...
               [outdir,'7p1_cm_methane_4mm_16mesh_line.csv'],'b:','FDS {\it\deltax} = 4 mm 16 mesh', ...
               [outdir,'7p1_cm_methane_2mm_16mesh_line.csv'],'b-','FDS {\it\deltax} = 2 mm 16 mesh')

%Z/D = .42
col1 = find(strcmp(M.colheaders,'3W_mean-x'));
col2 = find(strcmp(M.colheaders,'3W_mean'));
radial_profile([pltdir,'7p1_cm_CH4_w_zd_p42'],'line',[col1,col2],0,'relative',10, ...
               'Radial Position (m)','Vertical Velocity (m/s)','{\itz/D} = 0.42','','Northeast', ...
               -.05,.05,.02,-.05,.05,.02,0,3,.5,[outdir,'7p1_cm_methane_4mm_git.txt'], ...
               [expdir,'7p1_cm_CH4_w_zd_p42.csv'],'bo','Exp',exp_stride, ...
               [outdir,'7p1_cm_methane_4mm_line.csv'],'b--','FDS {\it\deltax} = 4 mm 1 mesh', ...
               [outdir,'7p1_cm_methane_4mm_16mesh_line.csv'],'b:','FDS {\it\deltax} = 4 mm 16 mesh', ...
               [outdir,'7p1_cm_methane_2mm_16mesh_line.csv'],'b-','FDS {\it\deltax} = 2 mm 16 mesh')

% Horizontal Velocity

%Z/D = .70
col1 = find(strcmp(M.colheaders,'U_mean-x'));
col2 = find(strcmp(M.colheaders,'U_mean'));
radial_profile([pltdir,'7p1_cm_CH4_u_zd_p70'],'line',[col1,col2],0,'relative',10, ...
               'Radial Position (m)','Horizontal Velocity (m/s)','{\itz/D} = 0.70','','Northeast', ...
               -.05,.05,.02,-.05,.05,.02,-0.5,0.5,.5,[outdir,'7p1_cm_methane_4mm_git.txt'], ...
               [expdir,'7p1_cm_CH4_u_zd_p70.csv'],'ro','Exp',exp_stride, ...
               [outdir,'7p1_cm_methane_4mm_line.csv'],'r--','FDS {\it\deltax} = 4 mm 1 mesh', ...
               [outdir,'7p1_cm_methane_4mm_16mesh_line.csv'],'r:','FDS {\it\deltax} = 4 mm 16 mesh', ...
               [outdir,'7p1_cm_methane_2mm_16mesh_line.csv'],'r-','FDS {\it\deltax} = 2 mm 16 mesh')

%Z/D = .56
col1 = find(strcmp(M.colheaders,'1U_mean-x'));
col2 = find(strcmp(M.colheaders,'1U_mean'));
radial_profile([pltdir,'7p1_cm_CH4_u_zd_p56'],'line',[col1,col2],0,'relative',10, ...
               'Radial Position (m)','Horizontal Velocity (m/s)','{\itz/D} = 0.56','','Northeast', ...
               -.05,.05,.02,-.05,.05,.02,-0.5,0.5,.5,[outdir,'7p1_cm_methane_4mm_git.txt'], ...
               [expdir,'7p1_cm_CH4_u_zd_p56.csv'],'ro','Exp',exp_stride, ...
               [outdir,'7p1_cm_methane_4mm_line.csv'],'r--','FDS {\it\deltax} = 4 mm 1 mesh', ...
               [outdir,'7p1_cm_methane_4mm_16mesh_line.csv'],'r:','FDS {\it\deltax} = 4 mm 16 mesh', ...
               [outdir,'7p1_cm_methane_2mm_16mesh_line.csv'],'r-','FDS {\it\deltax} = 2 mm 16 mesh')

%Z/D = .42
col1 = find(strcmp(M.colheaders,'2U_mean-x'));
col2 = find(strcmp(M.colheaders,'2U_mean'));
radial_profile([pltdir,'7p1_cm_CH4_u_zd_p42'],'line',[col1,col2],0,'relative',10, ...
               'Radial Position (m)','Horizontal Velocity (m/s)','{\itz/D} = 0.42','','Northeast', ...
               -.05,.05,.02,-.05,.05,.02,-0.5,0.5,.5,[outdir,'7p1_cm_methane_4mm_git.txt'], ...
               [expdir,'7p1_cm_CH4_u_zd_p42.csv'],'ro','Exp',exp_stride, ...
               [outdir,'7p1_cm_methane_4mm_line.csv'],'r--','FDS {\it\deltax} = 4 mm 1 mesh', ...
               [outdir,'7p1_cm_methane_4mm_16mesh_line.csv'],'r:','FDS {\it\deltax} = 4 mm 16 mesh', ...
               [outdir,'7p1_cm_methane_2mm_16mesh_line.csv'],'r-','FDS {\it\deltax} = 2 mm 16 mesh')

%Z/D = .28
col1 = find(strcmp(M.colheaders,'3U_mean-x'));
col2 = find(strcmp(M.colheaders,'3U_mean'));
radial_profile([pltdir,'7p1_cm_CH4_u_zd_p28'],'line',[col1,col2],0,'relative',10, ...
               'Radial Position (m)','Horizontal Velocity (m/s)','{\itz/D} = 0.28','','Northeast', ...
               -.05,.05,.02,-.05,.05,.02,-0.5,0.5,.5,[outdir,'7p1_cm_methane_4mm_git.txt'], ...
               [expdir,'7p1_cm_CH4_u_zd_p28.csv'],'ro','Exp',exp_stride, ...
               [outdir,'7p1_cm_methane_4mm_line.csv'],'r--','FDS {\it\deltax} = 4 mm 1 mesh', ...
               [outdir,'7p1_cm_methane_4mm_16mesh_line.csv'],'r:','FDS {\it\deltax} = 4 mm 16 mesh', ...
               [outdir,'7p1_cm_methane_2mm_16mesh_line.csv'],'r-','FDS {\it\deltax} = 2 mm 16 mesh')

% Mixture Fraction Profiles

%Z/D = 1.41
col1 = find(strcmp(M.colheaders,'f_mean-x'));
col2 = find(strcmp(M.colheaders,'f_mean'));
radial_profile([pltdir,'7p1_cm_CH4_f_zd_1p41'],'line',[col1,col2],0,'relative',10, ...
               'Radial Position (m)','Mixture Fraction','{\itz/D} = 1.41','','Northeast', ...
               0,.05,.01,0,.05,.01,0,1,0.2,[outdir,'7p1_cm_methane_4mm_git.txt'], ...
               [expdir,'7p1_cm_CH4_f_zd_1p41.csv'],'ko','Exp',exp_stride, ...
               [outdir,'7p1_cm_methane_4mm_line.csv'],'k--','FDS {\it\deltax} = 4 mm 1 mesh', ...
               [outdir,'7p1_cm_methane_4mm_16mesh_line.csv'],'k:','FDS {\it\deltax} = 4 mm 16 mesh', ...
               [outdir,'7p1_cm_methane_2mm_16mesh_line.csv'],'k-','FDS {\it\deltax} = 2 mm 16 mesh')

%Z/D = .70
col1 = find(strcmp(M.colheaders,'1f_mean-x'));
col2 = find(strcmp(M.colheaders,'1f_mean'));
radial_profile([pltdir,'7p1_cm_CH4_f_zd_p70'],'line',[col1,col2],0,'relative',10, ...
               'Radial Position (m)','Mixture Fraction','{\itz/D} = .70','','Northeast', ...
               0,.05,.01,0,.05,.01,0,1,0.2,[outdir,'7p1_cm_methane_4mm_git.txt'], ...
               [expdir,'7p1_cm_CH4_f_zd_p70.csv'],'ko','Exp',exp_stride, ...
               [outdir,'7p1_cm_methane_4mm_line.csv'],'k--','FDS {\it\deltax} = 4 mm 1 mesh', ...
               [outdir,'7p1_cm_methane_4mm_16mesh_line.csv'],'k:','FDS {\it\deltax} = 4 mm 16 mesh', ...
               [outdir,'7p1_cm_methane_2mm_16mesh_line.csv'],'k-','FDS {\it\deltax} = 2 mm 16 mesh')

%Z/D = .14
col1 = find(strcmp(M.colheaders,'2f_mean-x'));
col2 = find(strcmp(M.colheaders,'2f_mean'));
radial_profile([pltdir,'7p1_cm_CH4_f_zd_p14'],'line',[col1,col2],0,'relative',10, ...
               'Radial Position (m)','Mixture Fraction','               {\itz/D} = .14','','Northeast', ...
               0,.05,.01,0,.05,.01,0,1,0.2,[outdir,'7p1_cm_methane_4mm_git.txt'], ...
               [expdir,'7p1_cm_CH4_f_zd_p14.csv'],'ko','Exp',exp_stride, ...
               [outdir,'7p1_cm_methane_4mm_line.csv'],'k--','FDS {\it\deltax} = 4 mm 1 mesh', ...
               [outdir,'7p1_cm_methane_4mm_16mesh_line.csv'],'k:','FDS {\it\deltax} = 4 mm 16 mesh', ...
               [outdir,'7p1_cm_methane_2mm_16mesh_line.csv'],'k-','FDS {\it\deltax} = 2 mm 16 mesh')

%Z/D = .07
col1 = find(strcmp(M.colheaders,'3f_mean-x'));
col2 = find(strcmp(M.colheaders,'3f_mean'));
radial_profile([pltdir,'7p1_cm_CH4_f_zd_p07'],'line',[col1,col2],0,'relative',10, ...
               'Radial Position (m)','Mixture Fraction','               {\itz/D} = .07','','Northeast', ...
               0,.05,.01,0,.05,.01,0,1,0.2,[outdir,'7p1_cm_methane_4mm_git.txt'], ...
               [expdir,'7p1_cm_CH4_f_zd_p07.csv'],'ko','Exp',exp_stride, ...
               [outdir,'7p1_cm_methane_4mm_line.csv'],'k--','FDS {\it\deltax} = 4 mm 1 mesh', ...
               [outdir,'7p1_cm_methane_4mm_16mesh_line.csv'],'k:','FDS {\it\deltax} = 4 mm 16 mesh', ...
               [outdir,'7p1_cm_methane_2mm_16mesh_line.csv'],'k-','FDS {\it\deltax} = 2 mm 16 mesh')


% Temperature Profiles

%Z/D = 1.41
col1 = find(strcmp(M.colheaders,'T_mean-x'));
col2 = find(strcmp(M.colheaders,'T_mean'));
radial_profile([pltdir,'7p1_cm_CH4_T_zd_1p41'],'line',[col1,col2],0,'relative',10, ...
               'Radial Position (m)','Temperature (°C)','{\itz/D} = 1.41','','Northeast', ...
               0,.05,.01,0,.05,.01,0,3000,500,[outdir,'7p1_cm_methane_4mm_git.txt'], ...
               [expdir,'7p1_cm_CH4_T_zd_1p41.csv'],'ko','Exp',exp_stride, ...
               [outdir,'7p1_cm_methane_4mm_line.csv'],'k--','FDS {\it\deltax} = 4 mm 1 mesh', ...
               [outdir,'7p1_cm_methane_4mm_16mesh_line.csv'],'k:','FDS {\it\deltax} = 4 mm 16 mesh', ...
               [outdir,'7p1_cm_methane_2mm_16mesh_line.csv'],'k-','FDS {\it\deltax} = 2 mm 16 mesh')

%Z/D = .70
col1 = find(strcmp(M.colheaders,'1T_mean-x'));
col2 = find(strcmp(M.colheaders,'1T_mean'));
radial_profile([pltdir,'7p1_cm_CH4_T_zd_p70'],'line',[col1,col2],0,'relative',10, ...
               'Radial Position (m)','Temperature (°C)','{\itz/D} = .70','','Northeast', ...
               0,.05,.01,0,.05,.01,0,3000,500,[outdir,'7p1_cm_methane_4mm_git.txt'], ...
               [expdir,'7p1_cm_CH4_T_zd_p70.csv'],'ko','Exp',exp_stride, ...
               [outdir,'7p1_cm_methane_4mm_line.csv'],'k--','FDS {\it\deltax} = 4 mm 1 mesh', ...
               [outdir,'7p1_cm_methane_4mm_16mesh_line.csv'],'k:','FDS {\it\deltax} = 4 mm 16 mesh', ...
               [outdir,'7p1_cm_methane_2mm_16mesh_line.csv'],'k-','FDS {\it\deltax} = 2 mm 16 mesh')

%Z/D = .14
col1 = find(strcmp(M.colheaders,'2T_mean-x'));
col2 = find(strcmp(M.colheaders,'2T_mean'));
radial_profile([pltdir,'7p1_cm_CH4_T_zd_p14'],'line',[col1,col2],0,'relative',10, ...
               'Radial Position (m)','Temperature (°C)','{\itz/D} = .14','','Northeast', ...
               0,.05,.01,0,.05,.01,0,3000,500,[outdir,'7p1_cm_methane_4mm_git.txt'], ...
               [expdir,'7p1_cm_CH4_T_zd_p14.csv'],'ko','Exp',exp_stride, ...
               [outdir,'7p1_cm_methane_4mm_line.csv'],'k--','FDS {\it\deltax} = 4 mm 1 mesh', ...
               [outdir,'7p1_cm_methane_4mm_16mesh_line.csv'],'k:','FDS {\it\deltax} = 4 mm 16 mesh', ...
               [outdir,'7p1_cm_methane_2mm_16mesh_line.csv'],'k-','FDS {\it\deltax} = 2 mm 16 mesh')

%Z/D = .07
col1 = find(strcmp(M.colheaders,'3T_mean-x'));
col2 = find(strcmp(M.colheaders,'3T_mean'));
radial_profile([pltdir,'7p1_cm_CH4_T_zd_p07'],'line',[col1,col2],0,'relative',10, ...
               'Radial Position (m)','Temperature (°C)','{\itz/D} = .07','','Northeast', ...
               0,.05,.01,0,.05,.01,0,3000,500,[outdir,'7p1_cm_methane_4mm_git.txt'], ...
               [expdir,'7p1_cm_CH4_T_zd_p07.csv'],'ko','Exp',exp_stride, ...
               [outdir,'7p1_cm_methane_4mm_line.csv'],'k--','FDS {\it\deltax} = 4 mm 1 mesh', ...
               [outdir,'7p1_cm_methane_4mm_16mesh_line.csv'],'k:','FDS {\it\deltax} = 4 mm 16 mesh', ...
               [outdir,'7p1_cm_methane_2mm_16mesh_line.csv'],'k-','FDS {\it\deltax} = 2 mm 16 mesh')

% RMS Velocity Profiles

%Z/D = 0.5
col1 = find(strcmp(M.colheaders,'UB_rms-x'));
col2 = find(strcmp(M.colheaders,'UB_rms'));
radial_profile([pltdir,'7p1_cm_CH4_RMS_u_zd_p50'],'line',[col1,col2],0,'relative',10, ...
               'Radial Position (m)','U rms (m/s)','{\itz/D} = .5','','Northeast', ...
               0,.05,.01,0,.05,.01,0,1,.1,[outdir,'7p1_cm_methane_4mm_git.txt'], ...
               [expdir,'7p1_cm_CH4_RMS_u_zd_p50.csv'],'ko','Exp',exp_stride, ...
               [outdir,'7p1_cm_methane_4mm_line.csv'],'k--','FDS {\it\deltax} = 4 mm 1 mesh', ...
               [outdir,'7p1_cm_methane_4mm_16mesh_line.csv'],'k:','FDS {\it\deltax} = 4 mm 16 mesh', ...
               [outdir,'7p1_cm_methane_2mm_16mesh_line.csv'],'k-','FDS {\it\deltax} = 2 mm 16 mesh')

%Z/D = 0.5
col1 = find(strcmp(M.colheaders,'WB_rms-x'));
col2 = find(strcmp(M.colheaders,'WB_rms'));
radial_profile([pltdir,'7p1_cm_CH4_RMS_w_zd_p50'],'line',[col1,col2],0,'relative',10, ...
               'Radial Position (m)','W rms (m/s)','{\itz/D} = .5','','Northeast', ...
               0,.05,.01,0,.05,.01,0,1,.1,[outdir,'7p1_cm_methane_4mm_git.txt'], ...
               [expdir,'7p1_cm_CH4_RMS_w_zd_p50.csv'],'ko','Exp',exp_stride, ...
               [outdir,'7p1_cm_methane_4mm_line.csv'],'k--','FDS {\it\deltax} = 4 mm 1 mesh', ...
               [outdir,'7p1_cm_methane_4mm_16mesh_line.csv'],'k:','FDS {\it\deltax} = 4 mm 16 mesh', ...
               [outdir,'7p1_cm_methane_2mm_16mesh_line.csv'],'k-','FDS {\it\deltax} = 2 mm 16 mesh')



